﻿<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML5 SVG波浪翻滚背景动画特效</title>

<link rel="stylesheet" type="text/css" href="css/normalize.css" /><!--CSS RESET-->
<link rel="stylesheet" type="text/css" href="css/demo.css"><!--演示页面样式，使用时可以不引用-->
<link rel="stylesheet" href="css/style.css">

</head>
<body>

<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" class="wave"><defs></defs><path id="feel-the-wave" d=""></svg>

<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" class="wave"><defs></defs><path id="feel-the-wave-two" d=""></svg>

<div class="btn-wrapper">
  <a href="" class="btn" data-pause>暂停</a>
  <a href="" class="btn" data-play>播放</a>
</div>


<script type="text/javascript" src='js/TweenMax.min.js'></script>
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src='js/wavify.js'></script>
<script type="text/javascript" src='js/jquery.wavify.js'></script>
<script type="text/javascript">
	var wave1 = $('#feel-the-wave').wavify({
	  height: 80,
	  bones: 4,
	  amplitude: 60,
	  color: '#B289EF',
	  speed: .15
	});

	var wave2 = $('#feel-the-wave-two').wavify({
	  height: 60,
	  bones: 3,
	  amplitude: 40,
	  color: 'rgba(150, 97, 255, .8)',
	  speed: .25
	});

	$("[data-pause]").on('click', function(){
	  wave1.pause();
	  wave2.pause();
	  return false;
	});

	$("[data-play]").on('click', function(){
	  wave1.play();
	  wave2.play();
	  return false;
	});
</script>

</body>
</html>